﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WoChu.Autorun.Base.Dao;
using MB.Orm.Common;
using System.Web;
using Newtonsoft.Json;
using Model;
using Business;

namespace WebApi.Controllers
{
    public class SyncOrderController : ApiController
    {

        [HttpPost]
        public ResultModel PostOrderInfo(List<Deli_Order> OrderInfo)
        {
            try
            {
                new BPostOrder().PushOrder(OrderInfo);
            }
            catch (Exception ex)
            {
                return new ResultModel { RESULT = "failed", MESSAGE = "订单同步失败" + ex.Message, DATA = null };
            }

            ResultModel res = new ResultModel { RESULT = "success", MESSAGE = "订单同步成功", DATA = null };

            return res;
        }
        [HttpGet]
        public List<Deli_Order> getTest() {

            var list = new List<Deli_Order>();
            list.Add(new Deli_Order() { BatchNo = "1" });
            list.Add(new Deli_Order() { BatchNo = "2" });
            return list;
        }

    }
}
